Skip to main content

Get Routes

Gets all swap routes available when swapping the specified token_in to receive the specified token_out.

Related Queries
  • All Tokens: Use this query to fetch valid token IDs for token_in and token_out.
  • All Chains: Use this query to fetch valid chain UIDs when populating chain_uids.

Request URL

Method: POST

https://api.euclidprotocol.com/api/v1/routes

Curl

curl -X 'POST' \
  'https://api.euclidprotocol.com/api/v1/routes' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "token_in": "usdc",
    "token_out": "eth",
    "amount_in": "100000000",
    "chain_uids": []
}'

Parameters

ParameterTypeDescription
amount_inStringThe amount of tokens being swapped in.
token_inStringThe identifier of the token being swapped in.
token_outStringThe identifier of the token desired to receive.
externalBooleanOptional. If true, includes routes that may involve external Dexes.
chain_uidsArrayOptional list of specific chain UIDs to restrict routing paths.

Example Response

{
"paths": [
{
"path": [
{
"route": [
"usdc",
"eth"
],
"dex": "euclid",
"amount_in": "100000000",
"amount_out": "45377330596656768",
"chain_uid": "vsl",
"amount_out_for_hops": [
"eth: 45377330596656768"
]
}
],
"total_price_impact": "10.58"
}
]
}